<?php
// 动态获取当前登录用户的宠物名字列表信息
// header("content-type:text/html;charset=UTF-8");
include_once("conn.php");
include_once("u_getLoginInfo.php");

$sql_petlist = "SELECT * FROM pet_infos WHERE user_ID = '" . $userID . "'";
$result = mysqli_query($connect_DB, $sql_petlist);
if ($result) {
    $pet_num = mysqli_num_rows($result);
    if ($pet_num > 0) {
        while ($pet_row = mysqli_fetch_object($result)) {
            echo "
                <option value='" . $pet_row->pet_ID . "'>" . $pet_row->pet_Name . "</option>
            ";
        }
    } else {
        echo "<option value='' disabled>您当前暂无宠物信息</option>";
    }
}

?>